<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    


    <script>


const queryDetail = () => {
  console.log('query detail');
};
const queryList = () => {
  console.log('query list');
}
const queryPic = () => {
    console.log('query pic')
}
const request = new Map([
  ['getDetail', queryDetail],
  ['queryList', queryList]
]);


console.log(request,'????');
if (request.has('getDetail')) {
  request.get('getDetail')();
}
if (!request.has('queryPic')) {
  request.set('queryPic', queryPic);
}
// // or 循环执行
request.forEach(fn => {
    fn();
})


const map = new Map();
map.set('foo', 1);
map.set('bar', 2);
map.set(undefined, 'nah') 

console.log(map.get('foo'),99);  
console.log(map.has('foo'),'??11111111');
console.log(map,'??11111111');

for (let [key, value] of map.entries()) {
  console.log(key, value,'1111111111');
}
// "F" "no" 、"T" "yes"

// 等同于使用map.entries()
// for (let [key, value] of map) {
//   console.log(key, value,2222222222);
// }
// "F" "no"  、 "T" "yes"

map.forEach(function(value, key, map) {
  console.log(key, value);    // "F" "no"  、 "T" "yes"
});
   
obj={
    name:'myp',
    age:90
}
var arr=[1,2,45,5]
          

arr.forEach((item,index)=>{
    console.log(item,index,'???wwwwwwwwwww');
})
  for(var [key,index] in obj){
      
    console.log(key,'key');
 console.log(index,'index');

  }
    </script>
</body>
</html>